package com.calenda.setevent.entity;

import org.json.JSONObject;

public class GroupEntity {

	// "membercount": 59,
	// "role": "member",
	// "admin": "",
	// "description": "Nhà phát triển hệ thống",
	// "groupname": "ezpush",
	// "group": "public"

	private int membercount;

	private String role;

	private String admin;

	private String description;

	private String groupname;

	private String group;
	
	private String avatar;
	
	private String groupid;
	
	private JSONObject jsonObject;

	public GroupEntity() {
	}
	
	public GroupEntity(JSONObject jsonObject) {
		this.jsonObject = jsonObject;
		membercount = jsonObject.optInt("membercount", 0);
		role = jsonObject.optString("role", "");
		admin = jsonObject.optString("admin", "");
		description = jsonObject.optString("description", "");
		groupname = jsonObject.optString("groupname", "");
		group = jsonObject.optString("group", "");  
		avatar = jsonObject.optString("avatar", ""); 
		groupid= jsonObject.optString("groupid", ""); 
	}

	public GroupEntity(int membercount, String role, String admin,
			String description, String groupname, String group) {
		this.membercount = membercount;
		this.role = role;
		this.admin = admin;
		this.description = description;
		this.groupname = groupname;
		this.group = group;
	}
	
	

	public String getAvatar() {
		return avatar;
	}

	public void setAvatar(String avatar) {
		this.avatar = avatar;
	}

	public String getGroupid() {
		return groupid;
	}

	public void setGroupid(String groupid) {
		this.groupid = groupid;
	}

	public int getMembercount() {
		return membercount;
	}

	public void setMembercount(int membercount) {
		this.membercount = membercount;
	}

	public String getRole() {
		return role;
	}

	public void setRole(String role) {
		this.role = role;
	}

	public String getAdmin() {
		return admin;
	}

	public void setAdmin(String admin) {
		this.admin = admin;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getGroupname() {
		return groupname;
	}

	public void setGroupname(String groupname) {
		this.groupname = groupname;
	}

	public String getGroup() {
		return group;
	}

	public void setGroup(String group) {
		this.group = group;
	}
	
	public JSONObject toJson(){
		return this.jsonObject;
	}

	@Override
	public String toString() {
		return "GroupEntity [membercount=" + membercount + ", role=" + role
				+ ", admin=" + admin + ", description=" + description
				+ ", groupname=" + groupname + ", group=" + group + "]";
	}

}
